#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   统一诊断服务测试_boot_02_test.py
@Time    :   2025/03/20 13:31:28
@Author  :   YangLiang 
@Version :   1.0
@Contact :   yangl@genvict.com
@License :   (C)Copyright 2022-2025
@Desc    :   统一诊断服务测试BOOT
'''

from pandas._libs import interval
import pytest
import allure
import time
from pytest_assume.plugin import assume
from sqlalchemy import true
import Set_up
from commDriver.TS_CAN import *
import math


class Test_UnifiedDiagnosticService_BOOT:

    @allure.severity('critical')
    def test_3E_2711_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        logging.info('等待4.5s')
        time.sleep(4.5)
        for i in range(2):
            iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, False, 'UDS')
            logging.info('等待4.5s')
            time.sleep(4.5)
            iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 80", "", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "27 11", "67 11", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    @allure.title('在默认会话中，发送诊断请求$3E 01 检查电控单元须反馈否定应答代码0x12')
    @allure.description('在默认会话中，发送诊断请求$3E 01 检查电控单元须反馈否定应答代码0x12')
    def test_3E_NRC12_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 01", "7F 3E 12", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 81", "7F 3E 12", 0, iStep, False, 'UDS')

    
    @allure.severity('critical')
    def test_3E_NRC13_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 3E 01 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 3E 13"):
            assert resp[:4] == [0x03, 0x7F, 0x3E, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "03 3E 00 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 3E 13"):
            assert resp[:4] == [0x03, 0x7F, 0x3E, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    
    @allure.severity('critical')
    def test_22_Default(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F1 95", "62 F1 95", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F1 93", "62 F1 93", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_22_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F1 89", "62 F1 89", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F1 90", "62 F1 90", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_22_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F1 80", "62 F1 80", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F1 97", "62 F1 97", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_22_NRC13_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 22 F1 95 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 22 13"):
            assert resp[:4] == [0x03, 0x7F, 0x22, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "02 22 F1 90 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 22 13"):
            assert resp[:4] == [0x03, 0x7F, 0x22, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "04 22 F1 80 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 22 13"):
            assert resp[:4] == [0x03, 0x7F, 0x22, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    @allure.severity('critical')
    @allure.title('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$22服务')
    @allure.description('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$22服务')
    def test_22_NRC31(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F2 89", "7F 22 31", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F1 FF", " 7F 22 31", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F2 90", " 7F 22 31", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    @allure.title('在应用程序的默认会话中，电控单元须支持物理寻址和功能寻址的$2E服务的NRC7F')
    @allure.description('在应用程序的默认会话中，电控单元须支持物理寻址和功能寻址的$2E服务的NRC7F')
    def test_2E_NRC7F_Default(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 f4", 0, iStep, False, 'UDS')

        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "2E F1 90" + "11" * 17, "7F 2E 7F", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    @allure.title('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务的NRC31')
    @allure.description('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务的NRC31')
    def test_2E_NRC31_Func(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "2E F1 FF", "", 0, iStep, True, 'UDSFun')

    @allure.severity('critical')
    @allure.title('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务')
    @allure.description('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务')
    def test_2E_Power_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "2E F1 90" + Set_up.VINDataIdentifier_hex, "6E F1 90", 0, iStep, True, 'UDS')
        # 断电重启
        iStep = Driver['CAN'].restartETC_Power(Driver, iStep)
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F1 90", "62 F1 90" + Set_up.VINDataIdentifier_hex, 0, iStep, False, 'UDS')
    
    @allure.severity('critical')
    @allure.title('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务')
    @allure.description('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务')
    def test_2E_1101_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "2E F1 90" + Set_up.VINDataIdentifier_hex, "6E F1 90", 0, iStep, True, 'UDS')
        # 重启
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "11 01", "51 01", 0, iStep, False, 'UDS')
        time.sleep(1)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "22 F1 90", "62 F1 90" + Set_up.VINDataIdentifier_hex, 0, iStep, False, 'UDS')


    @allure.severity('critical')
    @allure.title('发送长度不正确的诊断请求$2E,电控单元须反馈否定应答代码0x13')
    @allure.description('发送长度不正确的诊断请求$2E,电控单元须反馈否定应答代码0x13')
    def test_2E_NRC13_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "3E 00", "7E 00", 0, iStep, True, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "03 2E F1 90 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 2E 13"):
            assert resp[:4] == [0x03, 0x7F, 0x2E, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "10 0A 2E F1 90 00 00 00", iStep)
        # with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 2E 13"):
        #     assert resp[:4] == [0x03, 0x7F, 0x2E, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")
        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "21 00 00 00 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 2E 13"):
            assert resp[:4] == [0x03, 0x7F, 0x2E, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    @allure.severity('critical')
    @allure.title('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务的NRC31')
    @allure.description('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务的NRC31')
    def test_2E_NRC31_Phy(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "2E F1 95" + "11" * 21, "7F 2E 31", 0, iStep, True, 'UDS')

    @allure.severity('critical')
    @allure.title('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务的NRC33')
    @allure.description('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务的NRC33')
    def test_2E_NRC33_Phy(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "2E F1 90" + "11" * 17, "7F 2E 33", 0, iStep, False, 'UDS')
    
    @allure.severity('critical')
    @allure.title('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务的NRC7F')
    @allure.description('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$2E服务的NRC7F')
    def test_2E_NRC7F_Phy(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "2E F1 90" + "11" * 17, "7F 2E 7F", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_2E_NRC22_Phy(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep = Driver['CAN'].unlock(Driver, iStep)
        # 设置车速
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 8)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "2E F1 90" + "11" * 17, "7F 2E 22", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].SetVehicleSpeed(Driver, iStep, 0)

    @allure.severity('critical')
    def test_31_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 02 03", "71 01 02 03", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 02 03", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_31_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 02 03", "71 01 02 03", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 02 03", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_31_NRC12_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 04 02 03", "7F 31 12", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 05 02 03", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_31_NRC13_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 31 02 03 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 31 13"):
            assert resp[:4] == [0x03, 0x7F, 0x31, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "05 31 01 02 03 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 31 13"):
            assert resp[:4] == [0x03, 0x7F, 0x31, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    @allure.severity('critical')
    @allure.title('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$22服务')
    @allure.description('在应用程序的扩展会话中，电控单元须支持物理寻址和功能寻址的$22服务')
    def test_31_NRC31_Extended(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 03", "50 03 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 05 03", "7F 31 31", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_31_NRC12_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].unlock(Driver,iStep, 2)
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 04 02 03", "7F 31 12", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 05 02 03", "", 0, iStep, False, 'UDSFun')

    @allure.severity('critical')
    def test_31_NRC13_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep = Driver['CAN'].unlock(Driver,iStep,2)
        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "01 31 02 03 00 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 31 13"):
            assert resp[:4] == [0x03, 0x7F, 0x31, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

        iStep, resp, _ = Driver['CAN'].Send_And_Receive(Driver, "05 31 01 02 03 00 00 00", iStep)
        with allure.step(f"第{iStep}步:检查响应消息内容 # 7F 31 13"):
            assert resp[:4] == [0x03, 0x7F, 0x31, 0x13], logging.error(f"响应消息内容错误, 实际响应消息内容: {resp}")

    @allure.severity('critical')
    def test_31_NRC31_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 05 03", "7F 31 31", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_31_NRC33_Programming(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 FF 01", "7F 31 33", 0, iStep, False, 'UDS')

    @allure.severity('critical')
    def test_31_NRC7F_Default(self, action, Driver):
        iStep = 1
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 02", "50 02 00 32 01 f4", 0, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "10 01", "50 01 00 32 01 f4", 1, iStep, False, 'UDS')
        iStep, _, _ = Driver['CAN'].checkReqResp(Driver, "31 01 02 03", "7F 31 7F", 0, iStep, False, 'UDS')